|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Object
|
+--com.caucho.vfs.StreamImpl
|
+--com.caucho.vfs.VfsStream
Stream encapsulating InputStream/OutputStream.
| Fields inherited from class com.caucho.vfs.StreamImpl |
nullPath, path |
| Constructor Summary | |
VfsStream()
Create an empty VfsStream. |
|
VfsStream(java.io.InputStream is,
java.io.OutputStream os)
Create a new VfsStream based on the java.io.* stream. |
|
VfsStream(java.io.InputStream is,
java.io.OutputStream os,
Path path)
|
|
| Method Summary | |
boolean |
canRead()
Returns true if this is a read stream. |
boolean |
canWrite()
Returns true if this is a writable stream. |
void |
close()
Closes the stream. |
void |
flush()
Flushes the write output. |
int |
getAvailable()
Returns the number of bytes available without blocking. |
boolean |
getFlushOnNewline()
Returns true if the buffer should be flushed on every newline. |
byte[] |
getNewline()
Returns the stream's natural newline character. |
long |
getReadPosition()
Returns the current read position of the underlying file. |
boolean |
hasSkip()
Returns true if the stream implements skip. |
void |
init(java.io.InputStream is,
java.io.OutputStream os)
Initializes a VfsStream with an input/output stream pair. |
static ReadStream |
openRead(java.io.InputStream is)
Opens a read stream based on a java.io.InputStream. |
static ReadStream |
openRead(java.io.InputStream is,
WriteStream ws)
|
static ReadWritePair |
openReadWrite(java.io.InputStream is,
java.io.OutputStream os)
|
static WriteStream |
openWrite(java.io.OutputStream os)
|
int |
read(byte[] buf,
int offset,
int length)
Reads the next chunk from the stream. |
void |
setCloseChildOnClose(boolean close)
|
void |
setFlushOnNewline(boolean value)
|
void |
setNewline(byte[] newline)
|
long |
skip(long n)
Skips a number of bytes, returning the bytes skipped. |
void |
write(byte[] buf,
int offset,
int length,
boolean isEnd)
Writes a buffer to the underlying stream. |
| Methods inherited from class com.caucho.vfs.StreamImpl |
clearWrite, getAttribute, getAttributeNames, getPath, removeAttribute, setAttribute, setPath |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
public VfsStream()
public VfsStream(java.io.InputStream is,
java.io.OutputStream os)
public VfsStream(java.io.InputStream is,
java.io.OutputStream os,
Path path)
| Method Detail |
public void init(java.io.InputStream is,
java.io.OutputStream os)
is - the underlying InputStream.os - the underlying OutputStream.public void setNewline(byte[] newline)
public byte[] getNewline()
StreamImplgetNewline in class StreamImpl
public static ReadWritePair openReadWrite(java.io.InputStream is,
java.io.OutputStream os)
public static ReadStream openRead(java.io.InputStream is)
is - the underlying InputStream.
public static ReadStream openRead(java.io.InputStream is,
WriteStream ws)
public static WriteStream openWrite(java.io.OutputStream os)
public boolean canRead()
StreamImplcanRead in class StreamImpl
public int read(byte[] buf,
int offset,
int length)
throws java.io.IOException
StreamImplread in class StreamImplcom.caucho.vfs.StreamImplbuffer - byte array receiving the data.offset - starting offset into the array.length - number of bytes to read.public boolean hasSkip()
StreamImplhasSkip in class StreamImpl
public long skip(long n)
throws java.io.IOException
StreamImplskip in class StreamImplcom.caucho.vfs.StreamImpln - the number of types to skip.
public int getAvailable()
throws java.io.IOException
StreamImplgetAvailable in class StreamImplpublic long getReadPosition()
StreamImplgetReadPosition in class StreamImplpublic boolean canWrite()
StreamImplcanWrite in class StreamImplpublic boolean getFlushOnNewline()
StreamImplgetFlushOnNewline in class StreamImplpublic void setFlushOnNewline(boolean value)
public void write(byte[] buf,
int offset,
int length,
boolean isEnd)
throws java.io.IOException
write in class StreamImplbuffer - the byte array to write.offset - the offset into the byte array.length - the number of bytes to write.isEnd - true when the write is flushing a close.
public void flush()
throws java.io.IOException
StreamImplflush in class StreamImplpublic void setCloseChildOnClose(boolean close)
public void close()
throws java.io.IOException
StreamImplclose in class StreamImpl
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||